var t = require("./2F838261EDBD87DF49E5EA666E8C7324.js"),
	e = require("./9F62E7A3EDBD87DFF9048FA4725C7324.js"),
	r = function(t) {
		return (t = t.toString())[1] ? t : "0" + t;
	},
	n = {
		stringify: function(t) {
			var r = {
				ct: t.ciphertext.toString(e.CryptoJS.enc.Base64)
			};
			return (
				t.iv && (r.iv = t.iv.toString()),
				t.salt && (r.s = t.salt.toString()),
				JSON.stringify(r).replace(/\s/g, "")
			);
		},
		parse: function(t) {
			var r = JSON.parse(t),
				n = e.CryptoJS.lib.CipherParams.create({
					ciphertext: e.CryptoJS.enc.Base64.parse(r.ct)
				});
			return (
				r.iv && (n.iv = e.CryptoJS.enc.Hex.parse(r.iv)),
				r.s && (n.salt = e.CryptoJS.enc.Hex.parse(r.s)),
				n
			);
		}
	};

module.exports = {
	formatTime: function(t) {
		var e = t.getFullYear(),
			n = t.getMonth() + 1,
			i = t.getDate(),
			a = t.getHours(),
			o = t.getMinutes(),
			s = t.getSeconds();
		return [e, n, i].map(r).join("/") + " " + [a, o, s].map(r).join(":");
	},
	timeFormat: function(t) {
		function e(t) {
			return t < 10 ? "0" + t : t;
		}
		var r = new Date(t.time),
			n = r.getFullYear(),
			i = r.getMonth() + 1,
			a = r.getDate(),
			o = r.getHours(),
			s = r.getMinutes(),
			g = r.getSeconds();
		return (
			(t.time =
				n +
				"-" +
				e(i) +
				"-" +
				e(a) +
				" " +
				e(o) +
				":" +
				e(s) +
				":" +
				e(g)),
			t
		);
	},
	Permissions: function() {
		var e = new Date().getTime(),
			r = "!@#$%^&" + e,
			n = t.hexMD5(r);
		return JSON.stringify({
			ciphertext: n,
			times: e
		});
	},
	getMouthAndDay: function() {
		var t = new Date();
		return t.getMonth() + 1 + "/" + t.getDate();
	},
	aes: function(t, r, i) {
		var i = i || "cannotseeme";
		return "get" == r
			? JSON.parse(
					e.CryptoJS.AES.decrypt(JSON.stringify(t), i, {
						format: n
					}).toString(e.CryptoJS.enc.Utf8)
			  )
			: e.CryptoJS.AES.encrypt(JSON.stringify(t), i, {
					format: n
			  }).toString();
	}
};
